package com.example.data.permission.url;

import lombok.Getter;

/**
 * Created by TD on 2021/3/2
 * 状态码枚举
 */
@Getter
public enum StatusCodeEnum implements IStatusCode {

    SUCCESS(0, "操作成功"),
    FAILED(-1, "操作失败"),
    SYSTEM_ERROR(1, "系统错误"),
    INVALID_TOKEN(401, "无效令牌"),
    REQUEST_UNAUTHORIZED(401, "请求未授权"),
    LOGIN_EXPIRED(403, " 当前用户登录已过期，请从首页登录后跳转！"),
    ACCESS_DENIED(403, "权限不足,无法访问");

    private int code;
    private String msg;

    StatusCodeEnum(int code, String msg) {
        this.setCode(code);
        this.setMsg(msg);
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}

